$(".record").click(function(){
	window.location.href="../html/record.html?flag=1"
})
$(".withdrawal").click(function(){
	if(delflag=="1"){
		alert("您的帐号已被冻结，请联系管理员")
	}else{
		window.location.href="../html/withdrawal.html?flag=1"
	}
})
$(".countpErson").click(function(){
	window.location.href="../html/countpErson.html"
})
var delflag;
$(function(){
	$.ajax({
		url:'../userController/getUser',
		success:function(data){
			console.log(data);
			$("#balance").html(data.balance.toFixed(2))
			$("#accumulated_amount").html(data.accumulated_amount.toFixed(2))
			$("#count").html(data.count)
			delflag=data.delflag;
			console.log(delflag);
			if(data.identity=="代理推广" || data.identity=="平台推广"){
				$(".plase1").css("display","none")
				$(".fn").css("display","none")
				$(".tu").css("justify-content","center")
			}
		}
	})
})
$(".plase1").click(function(){
	$("#loading").css("display","block")
	$.ajax({
		url:'../uploadController/invitation',
		data:{
			"type":"1"
		},
		success:function(data){
			$("#loading").css("display","none")
			$(".posterBox").html("<img src='"+data+"'>")
			$(".poster").css("display","flex");
		}
	})
})
$(".plase2").click(function(){
	$("#loading").css("display","block")
	$.ajax({
		url:'../uploadController/invitation',
		data:{
			"type":"2"
		},
		success:function(data){
			$("#loading").css("display","none")
			$(".posterBox").html("<img src='"+data+"'>")
			$(".poster").css("display","flex");
		}
	})
})
$("#close").click(function(){
		$(".poster").css("display","none");
})